package com.zyong.design.pattern.command.case2;

/**
 * 电灯打开命令
 * @program: zyong-design-pattern
 * @ClassName: ElectricLightOnCommand
 * @author: zyong
 * @create: 2024-03-27 00:16
 */
public class ElectricLightOnCommand implements Command {
    private ElectricLightReceiver electricLightReceiver;

    public ElectricLightOnCommand(ElectricLightReceiver electricLightReceiver) {
        this.electricLightReceiver = electricLightReceiver;
    }

    @Override
    public void execute() {
        electricLightReceiver.on();
    }

    @Override
    public void undo() {
        electricLightReceiver.off();
    }
}
